/*
 * Daniel R Padilla
 *
 * Copyright (c) 2008, Daniel R Padilla
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.databasefacade.translator;

import java.util.ArrayList;

import org.databasefacade.select.functions.Function;

public class DefaultAnsiFunctions {

	public static String getFunctionSQL(String functionType, ArrayList parameters) {
		if ( functionType.equals(Function.COUNT) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.MAX) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.MIN) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.AVG) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.SUM) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.STDEV) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.VARIANCE) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.TRIM) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.CHAR_LENGTH) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.SUBSTRING) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.ABS) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.MOD) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.POW) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.ROUND) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.SQRT) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.COS) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.SIN) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.TAN) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.ACOS) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.ASIN) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.ATAN) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.CURDATE) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.CURTIME) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.NOW) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.DAY) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.MONTH) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.YEAR) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.HOUR) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.MINUTE) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.TIME_ADD) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.TIME_DIFF) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.DAYOFWEEK) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.DAYOFMONTH) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.DAYOFYEAR) ) {
			return functionType + "(" + parameters.get(0) + ")";
		} else if ( functionType.equals(Function.REPLACE_IF_NULL) ) {
			return functionType + "(" + parameters.get(0) + ")";
		}
		return "The function type " + functionType + " is not supported";
	}
}
